<?php
$session=Yii::$app->session;
$message_success=$session->getFlash('message_success');
$message_error=$session->getFlash('message_error');
$message_info=$session->getFlash('message_info');
$message_warning=$session->getFlash('message_warning');
if(isset($message_success) || isset($message_error) || isset($message_info) || isset($message_warning)): ?>
<section class="panel">
    <div class="panel-body">
    	<?php if(isset($message_success)): ?>
        <div class="alert alert-success alert-block fade in" style="margin-bottom:0px;">
            <button data-dismiss="alert" class="close close-sm" type="button">
                <i class="fa fa-times"></i>
            </button>
            <strong>恭喜!</strong>
            <?php
            if(is_string($message_success)){
            	echo $message_success;
            }?>
        </div>
        <?php endif;?>

        <?php if(isset($message_error)): ?>
        <div class="alert alert-block alert-danger fade in" style="margin-bottom:0px;">
            <button data-dismiss="alert" class="close close-sm" type="button">
                <i class="fa fa-times"></i>
            </button>
            <strong>错误!</strong>
             <?php
            if(is_string($message_error)){
            	echo $message_error;
            }elseif (is_array($message_error)){
                $message_error=array_values($message_error);
            	if(count($message_error)==1){
            		echo $message_error[0][0];
            	}else{
	            	echo '<br>';
	            	foreach($message_error as $key=>$message){
	            		echo ($key+1).'、'.$message[0].'<br>';
	            	}
            	}
            }?>
        </div>
        <?php endif;?>

        <?php if(isset($message_info)): ?>
        <div class="alert alert-info fade in" style="margin-bottom:0px;">
            <button data-dismiss="alert" class="close close-sm" type="button">
                <i class="fa fa-times"></i>
            </button>
            <strong>注意!</strong>
             <?php
            if(is_string($message_info)){
            	echo $message_info;
            }elseif (is_array($message_info)){
                $message_info=array_values($message_info);
            	if(count($message_info)==1){
            		echo $message_info[0][0];
            	}else{
	            	echo '<br>';
	            	foreach($message_info as $key=>$message){
	            		echo ($key+1).'、'.$message[0].'<br>';
	            	}
            	}
            }?>
        </div>
        <?php endif;?>

        <?php if(isset($message_warning)): ?>
        <div class="alert alert-warning fade in" style="margin-bottom:0px;">
            <button data-dismiss="alert" class="close close-sm" type="button">
                <i class="fa fa-times"></i>
            </button>
            <strong>警告!</strong>
             <?php
            if(is_string($message_warning)){
            	echo $message_warning;
            }elseif (is_array($message_warning)){
                $message_warning=array_values($message_warning);
            	if(count($message_warning)==1){
            		echo $message_warning[0][0];
            	}else{
	            	echo '<br>';
	            	foreach($message_warning as $key=>$message){
	            		echo ($key+1).'、'.$message[0].'<br>';
	            	}
            	}
            }?>
        </div>
        <?php endif;?>
    </div>
</section>
<?php endif;?>